<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__STATIC__/res/layui/css/layui.css" media="all">
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color: #FF5722">*</span>配置项分组</label>
        <div class="layui-input-block">
            <select name="config_group">
                {foreach $configGroups as $key=>$name}
                <option value="{$key}" {if $key eq $websiteConfig['config_group']} selected {/if}>{$name}</option>
                {/foreach}
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color: #FF5722">*</span> 配置项名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" lay-verify="required" placeholder="请输入配置项名称" lay-reqtext="请输入配置项名称" autocomplete="off" class="layui-input" value="{$websiteConfig['name']}">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">配置项标识</label>
        <div class="layui-input-block">
            <input type="text" name="config_code" readonly disabled placeholder="请输入配置项标识"  autocomplete="off" class="layui-input" value="{$websiteConfig['config_code']}">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color: #FF5722">*</span> 配置项类型</label>
        <div class="layui-input-block">
            <select name="field_type">
                <option value="input" {if $websiteConfig['field_type'] eq 'input'} selected {/if}>单行文本</option>
                <option value="textarea" {if $websiteConfig['field_type'] eq 'textarea'} selected {/if}>多行文本</option>
                <option value="file" {if $websiteConfig['field_type'] eq 'file'} selected {/if}>文件</option>
                <option value="image" {if $websiteConfig['field_type'] eq 'image'} selected {/if}>图片</option>
                <option value="date" {if $websiteConfig['field_type'] eq 'date'} selected {/if}>日期</option>
                <option value="datetime" {if $websiteConfig['field_type'] eq 'datetime'} selected {/if}>日期时间</option>
                <option value="map" {if $websiteConfig['field_type'] eq 'map'} selected {/if}>地图</option>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label"> 排序</label>
        <div class="layui-input-block">
            <input type="text" name="sort" placeholder="请输入排序" autocomplete="off" class="layui-input" value="{$websiteConfig['sort']}">
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color: #FF5722">*</span> 状态</label>
        <div class="layui-input-block">
            <input type="checkbox" {if $websiteConfig['status'] eq 1}checked{/if} lay-verify="required" lay-filter="status" name="status" lay-skin="switch" lay-text="启用|禁用" value="1">
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="hidden" value="{$websiteConfig['id']}" name="id" />
        <input type="hidden" name="website_code" value="{$websiteCode}" />
        <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" id="layuiadmin-app-form-submit" value="确认添加">
        <input type="button" lay-submit lay-filter="layuiadmin-app-form-edit" id="layuiadmin-app-form-edit" value="确认编辑">
    </div>
</div>

<script src="__STATIC__/res/layui/layui.js"></script>
<script>
    layui.config({
        base: '__STATIC__/res/' //静态资源所在路径
    }).use(['index', 'form'])
</script>
</body>
</html>